<?php
namespace Kuoqi\Cli;

use Kuoqi\Error;

class Behavior{
    protected $command = '';//模块执行的命令
    protected $params = array();//命令参数信息
    protected $document = array();//配置需要的命令信息们
    protected $global = array();//环境变量的参数
    public function __construct($comm,$params,$global)
    {
        $this->command = $comm;
        $this->params = $params;
        $this->global = $global;
    }

    /**
     * createby kuoqi at 2022/11/11 23:05 开始方法
     * @throws Error
     */
    public function start(){
        throw new Error(sprintf("请实例化%s->start的执行方法",get_called_class()));
    }

    public function help(){
        foreach($this->document as $item){
            $this->show($item);
        }
    }

    /**
     * createby kuoqi at 2022/11/11 23:05 显示信息
     * @param $log
     */
    public function show($log){
        echo $log.PHP_EOL;
    }

    public function error($die){
        die($die.PHP_EOL);
    }

}